import request from '@/utils/request'

// 查询全部产品列表
export function productListAll() {
  return request({
    url: '/basic/productServer/listing',
    method: 'get',
  })
}

// 查询分页产品列表
export function productList() {
  return request({
    url: '/basic/productServer/list',
    method: 'get',
    params: params
  })
}

// 查询产品详情
export function productDetail(productId) {
  return request({
    url: `/basic/productServer/${productId}`,
    method: 'get',
  })
}

// 新增产品
export function productAdd(data) {
  return request({
    url: '/basic/productServer/add',
    method: 'post',
    data: data
  })
}

// 编辑产品
export function productEdit(data) {
  return request({
    url: '/basic/productServer/edit',
    method: 'post',
    data: data
  })
}

// 删除产品
export function productDelete(productIds) {
  return request({
    url: `/basic/productServer/remove/${productIds}`,
    method: 'get',
  })
}

// 自动生成产品编号
export function genProductNumber() {
  return request({
    url: '/basic/productServer/getProductCode',
    method: 'get',
  })
}
